<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        #box{
            width: 200px;
            height: 200px;
            background: red;
        }
    </style>
</head>
<body>
    <button id="btn">点击</button>
    <div id="box"></div>
    <script>
        var btn = document.getElementById('btn');
        var box = document.getElementById('box');

        btn.onclick = function(){
            // console.log(box.style.width)
            if(box.style.width == '200px'){
                alert('条件成立')
            }else{
                alert('条件不成立')
            }
            
        }

        /*
            style 是行间样式

            href
            src

            tagName
        */
    </script>
</body>
</html>